var CWAOffline = {
	read:function(fp){  <!-- reading a local file -->
		
		try {
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		} 
		catch (e) {
			alert("Permission to read file was denied.");
		}

		const DIR_SERVICE = new Components.Constructor("@mozilla.org/file/directory_service;1","nsIProperties");
		try { 
			path=(new DIR_SERVICE()).get("ProfD", Components.interfaces.nsIFile).path; 
		} 
		catch (e) {
			alert("error");
		}
		
		
		if (path.search(/\\/) != -1) {
			path = path + "\\";
		} 
		else {
			path = path + "/";
		}
		file = path+fp;
				
		var afile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
		afile.initWithPath(file);
		
		if ( afile.exists() == false ) {
			alert("File does not exist");
		}
		
		var is = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance( Components.interfaces.nsIFileInputStream );
		is.init( afile,0x01, 00004, null);
		
		var sis = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance( Components.interfaces.nsIScriptableInputStream );
		sis.init( is );
		
		var output = sis.read( sis.available() );
		alert(output); 
		
	},

	write:function(){
	
	},


	delete:function(fp){
		
		try {
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		} 
		catch (e) {
			alert("Permission to save file was denied.");
		}
		
		const DIR_SERVICE = new Components.Constructor("@mozilla.org/file/directory_service;1","nsIProperties");
		try { 
			path=(new DIR_SERVICE()).get("ProfD", Components.interfaces.nsIFile).path; 
		} 
		catch (e) {
			alert("error");
		}

		if (path.search(/\\/) != -1) {
			path = path + "\\";
		} 
		else {
			path = path + "/";
		}

		file = path+fp;


		var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
  		aFile.initWithPath(file);
  		aFile.remove(false);
	}

};